<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./css/common.css">
    <link rel="stylesheet" href="./css/blogger.css">
    <!-- <link rel="stylesheet" href="./css/blog_content.css"> -->
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    <!-- <link rel="stylesheet" href="editor.md/css/editormd.min.css" /> -->
</head>

<body>

    <div class="nav">
        <div class="left">
            <img src="./asset/img/logo.png" alt="" class="via">
            <div>KOKYU博客</div>
        </div>
        <div class="right">
            <a href="./home.html" target="_top">主页</a>
            <a href="./personal.html" target="_top">个人</a>
            <a href="./editor.html" target="_top">创作</a>
            <a onclick="logout()" href="./login.html" target="_top">注销</a>
        </div>
    </div>

    <script>
        //个人界面跳转
        const token = localStorage.getItem('token');
        const personalUrl = `./personal.html?t_uid=${token}`;
        document.querySelector('a[href="./personal.html"]').setAttribute('href', personalUrl);

        //创作界面跳转
        const editorUrl = `./editor.html?t_uid=${token}`;
        document.querySelector('a[href="./editor.html"]').setAttribute('href', editorUrl);

        
        //登出
        function logout() {
            localStorage.removeItem('token');
        }
    </script>
</body>

</html>